//
//  PageScrollVertical.h
//  ebook
//
//  Created by mt on 16/8/8.
//  Copyright © 2016年 Moton. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "Bookmark.h"
#import "ChapterContent.h"

@class PageScrollVerticalView;
@protocol PageScrollVerticalViewDelegate <NSObject>

-(void)pageScrollVerticalView:(PageScrollVerticalView *)view shouldSkipChapterIspre:(BOOL)isPre;//点击翻页时，通知外部controler做向前或向后翻页操作
-(void)pageScrollVerticalView:(PageScrollVerticalView *)view changeToChapter:(NSString *)chapterid;//视图切换时需要更新当前章节
-(void)pageScrollVerticalView:(PageScrollVerticalView *)view scrollViewDidEndDecelerating:(UIScrollView *)scrollView;

@end

@interface PageScrollVerticalView : UIView

@property (nonatomic, strong) UIScrollView *scrollView;
@property (nonatomic, strong) Bookmark *bookmark;//当前阅读位置

@property (nonatomic,weak) id<PageScrollVerticalViewDelegate> delegate;


- (void)resetColor;
- (void)menuShow:(BOOL)isshow;

//自动翻页滚到下一屏
- (void)autoRead;

//滚动阅读 开始
- (void)autoScrollRead;
//滚动阅读 停止: force:获取下一章数据失败?YES:NO
- (void)stopAutoScrollReadForce:(BOOL)force;

//自动翻页一点点滚动
- (void)autoReadSetScrollContentOffSet:(CGPoint)offSet;

/*加载视图数据
 *direct  0:当前，-1:向前，1:向后
 *cpercent 当前章节内部的阅读百分比  percent<0时忽略这个值
 */
-(void)loadPageCurrent:(ChapterContent *)cchapterContent pre:(ChapterContent *)pchapterContent next:(ChapterContent *)nchapterContent curentPercent:(float)cpercent direct:(int)direct;

@end
